package com.yzt.zhuju.dialog;

import android.annotation.SuppressLint;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.yzt.zhuju.R;

/**
 * author : bob
 * date   : 2023/1/16
 * desc   : 用户等级弹窗
 */
@SuppressLint("SetTextI18n")
public class UserLevelDialog extends CenterBaseDialog {

    private TextView tvLevel;

    private ImageView imgLevel;

    @Override
    public int getLayoutRes() {
        return R.layout.dialog_user_level;
    }

    @Override
    public void bindView(View v) {
        tvLevel = findViewById(R.id.tv_level);
        imgLevel = findViewById(R.id.img_level);

        int lv = getArguments().getInt("extra_level", 0);
        int obj = getArguments().getInt("extra_obj", 0);
        String icon = getArguments().getString("extra_icon");

        tvLevel.setText("Riches LV." + lv);

        Glide.with(this).load(icon).into(imgLevel);

//        if (obj == 1) {
//            Glide.with(this).load(UserLevelUtils.getWealthBigIcon(getContext(), lv)).into(imgLevel);
//        } else {
//            Glide.with(this).load(UserLevelUtils.getCharmBigIcon(getContext(), lv)).into(imgLevel);
//        }

        findViewById(R.id.img_close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismissAllowingStateLoss();
            }
        });
    }
}
